﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Miner.Model.Logic
{
    public class GameOptions
    {
        public int xBlocksCount{get;private set;}
        public int yBlocksCount{get;private set;}
        public int MinesCount{get;private set;}
        public int BlockSize{get;private set;}

        public GameOptions(decimal width, decimal height, decimal minesCount)
        {
            try
            {
                this.xBlocksCount = Convert.ToInt32(width);
                this.yBlocksCount = Convert.ToInt32(height);
                this.MinesCount = Convert.ToInt32(minesCount);
            }
            catch(Exception)
            {
                this.xBlocksCount = 5;
                this.yBlocksCount = 5;
                this.MinesCount = 5;

                MessageBox.Show("Some error happened! Game options were set to defaults!");
            }
            this.BlockSize=20;
        }

        public GameOptions(int width, int height, int size, int minesCount)
        {
            this.xBlocksCount= width;
            this.yBlocksCount= height;
            this.MinesCount = minesCount;
            this.BlockSize = size;
        }
    }
}
